# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=xssscan
pkgver=17.7f1ea90
pkgrel=3
epoch=1
pkgdesc='Command line tool for detection of XSS attacks in URLs. Based on ModSecurity rules from OWASP CRS.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner' 'blackarch-fuzzer')
arch=('x86_64' 'aarch64')
url='https://github.com/gwroblew/detectXSSlib'
license=('custom')
depends=('gcc-libs')
makedepends=('git')
source=("$pkgname::git+https://github.com/gwroblew/detectXSSlib.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$pkgname/tools/$pkgname"

  g++ -Wno-multichar -I../../detectxsslib -o $pkgname "$pkgname.cpp" \
    ../../detectxsslib/detectxsslib.c
}

package() {
  cd "$pkgname/tools/$pkgname"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 "$srcdir/$pkgname/license.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

